package com.xqy.wexmini.utils.oss;


import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;

public class UploadUtils {
    public String asd(MultipartFile img) throws IOException {
        Fileload storage=new Fileload();
        String filename = img.getOriginalFilename();
        String contentType = img.getContentType();
        String extension = filename.substring(0,filename.lastIndexOf("."));
        String fullPath = storage.upload(img.getInputStream(), extension, contentType);
        System.out.println(fullPath);
        return fullPath;
    }
    //指定文件名称上传
    public String lingshi(MultipartFile img) throws IOException {
        Fileload storage=new Fileload();
        String contentType = img.getContentType();
        String extension = "temporary";
        String fullPath = storage.upload(img.getInputStream(), extension, contentType);
        System.out.println(fullPath);
        return fullPath;
    }
    //删除文件
    public String shanchu(String name){
        Fileload fileload = new Fileload();
        fileload.deletelingshi(name);
        return null;
    }

/*    //扫描图片
    public String shaomiao2(String name){
        Fileload fileload=new Fileload();
        return fileload.shaomiao(name);
    }*/
}
